package com.ruoyi.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mapper.ErpPurchaseInventoryMapper;
import com.ruoyi.domain.ErpPurchaseInventory;
import com.ruoyi.service.IErpPurchaseInventoryService;

/**
 * 采购入库Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-17
 */
@Service
public class ErpPurchaseInventoryServiceImpl implements IErpPurchaseInventoryService 
{
    @Autowired
    private ErpPurchaseInventoryMapper erpPurchaseInventoryMapper;

    /**
     * 查询采购入库
     * 
     * @param id 采购入库主键
     * @return 采购入库
     */
    @Override
    public ErpPurchaseInventory selectErpPurchaseInventoryById(String id)
    {
        return erpPurchaseInventoryMapper.selectErpPurchaseInventoryById(id);
    }

    /**
     * 查询采购入库列表
     * 
     * @param erpPurchaseInventory 采购入库
     * @return 采购入库
     */
    @Override
    public List<ErpPurchaseInventory> selectErpPurchaseInventoryList(ErpPurchaseInventory erpPurchaseInventory)
    {
        return erpPurchaseInventoryMapper.selectErpPurchaseInventoryList(erpPurchaseInventory);
    }

    /**
     * 新增采购入库
     * 
     * @param erpPurchaseInventory 采购入库
     * @return 结果
     */
    @Override
    public int insertErpPurchaseInventory(ErpPurchaseInventory erpPurchaseInventory)
    {
        erpPurchaseInventory.setCreateTime(DateUtils.getNowDate());
        return erpPurchaseInventoryMapper.insertErpPurchaseInventory(erpPurchaseInventory);
    }

    /**
     * 修改采购入库
     * 
     * @param erpPurchaseInventory 采购入库
     * @return 结果
     */
    @Override
    public int updateErpPurchaseInventory(ErpPurchaseInventory erpPurchaseInventory)
    {
        erpPurchaseInventory.setUpdateTime(DateUtils.getNowDate());
        return erpPurchaseInventoryMapper.updateErpPurchaseInventory(erpPurchaseInventory);
    }

    /**
     * 批量删除采购入库
     * 
     * @param ids 需要删除的采购入库主键
     * @return 结果
     */
    @Override
    public int deleteErpPurchaseInventoryByIds(String[] ids)
    {
        return erpPurchaseInventoryMapper.deleteErpPurchaseInventoryByIds(ids);
    }

    /**
     * 删除采购入库信息
     * 
     * @param id 采购入库主键
     * @return 结果
     */
    @Override
    public int deleteErpPurchaseInventoryById(String id)
    {
        return erpPurchaseInventoryMapper.deleteErpPurchaseInventoryById(id);
    }
}
